{extend name='main'}

{block name="content"}
<div class="think-box-shadow">
    <table class="layui-table margin-top-15" lay-skin="line">
        {notempty name='modules'}
        <thead>
        <tr>
            <th class='text-left nowrap'>模块名称</th>
            <th class='text-left nowrap'>模块描述</th>
            <th class='text-left nowrap'>当前版本</th>
            <th></th>
        </tr>
        </thead>
        {/notempty}
        <tbody>
        {foreach $modules as $key=>$vo}
        <tr>
            <td class='text-left nowrap'>{$vo.name}</td>
            <td class='text-left nowrap'>{$vo.content}</td>
            <td class='text-left nowrap'>
                <div class="inline-block pointer" data-title="查看模块版本" data-modal="{:url('change')}?name={$vo.name}">
                    {if isset($vo.local)} {$vo.local.version}
                    {if $vo.version > $vo.local.version}
                    <span class="color-red margin-left-5">{$vo.version}</span>
                    {else}
                    <span class="color-desc margin-left-5">{$vo.type_desc}</span>
                    {/if}
                    {else}<span class="color-desc margin-left-5">{$vo.type_desc}</span>{/if}
                </div>
            </td>
            <td class="text-left">
                {if $vo.type_code eq 1} <a class="layui-btn layui-btn-xs" data-action="{:url('install')}" data-value="name#{$vo.name}">安 装</a>{/if}
                {if $vo.type_code eq 2} <a class="layui-btn layui-btn-xs" data-action="{:url('install')}" data-value="name#{$vo.name}">更 新</a>{/if}
            </td>
        </tr>
        {/foreach}
        </tbody>
    </table>
    {empty name='modules'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
</div>
{/block}